package cn.tx.service.impl.annotation.enums;

public enum OperatorType {

    QUERY("查询", (byte)1),

    MANAGE("管理", (byte)2),

    ;
    private final String name;
    private final byte value;

    OperatorType(String name, byte value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public byte getValue() {
        return value;
    }

    public static OperatorType getType(int value) {
        for(OperatorType type: values()) {
            if(type.value == value) {
                return type;
            }
        }
        return null;
    }

}
